package com.mapull.jarlib;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * @author Mapull
 * @date 2024-04-04
 */
public class MyJacksonFirst {
    public static void main(String[] args) throws IOException {
        Student student = new Student();
        student.setName("张三");
        student.setAge(26);
        student.setScore(89.5);

        ObjectMapper mapper = new ObjectMapper();
        mapper.writeValue(System.out, student);

        Student value = mapper.readValue("{\"name\":\"张三\",\"age\":26,\"score\":89.5}", Student.class);
    }
}
